<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<jsp:useBean id="db" class="connBean.ConnDB" scope="page" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <base href="<%=basePath%>">
    
    <title>删除购物车商品</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <%request.setCharacterEncoding("utf-8");
    String p_id=request.getParameter("p_id");
    int c_id=Integer.parseInt(request.getParameter("c_id"));
    db.OpenConn();
    db.createStmt();
    String sql="delete from shoppingcart where c_id="+c_id+" and p_id='"+p_id+"'";
    int result =db.Update(sql);
    if(result!=0){
    response.sendRedirect("shoppingCart.jsp");
    }
    else{
    %>
          删除失败，系统出错！
    <%
    db.closeStmt();
    db.closeConn();
    response.setHeader("Refresh","5;URL=shoppingCart.jsp");
    }
   %>
  </body>
</html>
